const fs = require('fs');
fs.open('inputfs.txt','w+',(err,fd)=>{
	console.log(fd);
	fs.write(fd,'hello world.',(err,writen,str)=>{
		if(err){
			console.log(err.message);
		}
	})
	const bf = Buffer.alloc(100);
	fs.read(fd,bf,0,100,0,(err,readbytes,buff)=>{
		console.log(buff.toString());
	})
	if(!err){
		fs.close(fd,(err)=>{
			if(err){
				console.error(err.message);
			}
		});
	}
});